package com.idc.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HiController {

    @PreAuthorize("hasAuthority('hi')")
    @GetMapping("hi")
    public String hi(){

        return "hi ~~~~~";
    }

    @PreAuthorize("hasAuthority('go')")
    @GetMapping("go")
    public String go(){

        return "go ~~~~~";
    }

    @PreAuthorize("hasAuthority('run')")
    @GetMapping("run")
    public String run(){

        return "run ~~~~~";
    }

}
